<?php include "inc/conn.php";?><?php include "inc/pubs.php";?>
<?php include "inc/safe.php";?><?php include "inc/sqls.php";?>
<?php
$pagesize = "10";//修改每页个数
$page = trim($_GET["page"]);
$th = $_COOKIE['name'];
$dn = $_COOKIE['pass'];
//判断是否记忆登陆
If($dn == md5($th.$ao)){
}else{
//webalert("请先登陆(I1)!","login.php?tt=".$tts);
}
$db=ConnectMysqli::getIntance($conn);
$keys= "".$_GET['d'];
?><!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />
<meta name="apple-esle-web-app-capable" content="yes" />
<title>订单详情页</title>
<meta name="author" content="yujianyue, admin@ewuyi.net">
<meta name="copyright" content="www.12391.net">
<link href="inc/css/style.css<?php echo $dp; ?>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="inc/js/js.js<?php echo $dp; ?>"></script>
<!--- <?php echo $ad; ?> --->
</head>
<body onLoad="inst();">
<div class="html">
<div class="divs" id="divs">
<div id="head" class="head" >
<div class="bs">订单详情</div>
</div>
<div class="main" id="main">
<?php
$ename = $cuser;
$urls= "";
$db=ConnectMysqli::getIntance($conn);
$sql="SELECT COUNT(*)  FROM `{$no}` where `{$ow}` = '{$keys}'";
$list=$db->getRow($sql);
$lf=$list['COUNT(*)'];
$pagecount = bcdiv($lf+$pagesize-1,$pagesize,0); //算出总页数
if(!isset($page)) $page = 1; //如果没有指定显示页码，缺省为显示第一页
if(!is_numeric($page)) $page = 1;
if($page<1) $page = 1; //如果页码比1小，则显示第一页
if($page>$pagecount) $page = $pagecount; //如果页码比总页数大，则显示最后一页
$p = $page * $pagesize + 1 - $pagesize -1;
if($p<0) $p = 0; //按理说$page肯定大于1这行不用加
$sql="SELECT *  FROM `{$no}` WHERE  `{$ow}` = '{$keys}'";
$sql.=" ORDER BY `{$ow}` DESC "; //如需定义删行首双斜杠并修改字段ID为自定义字段
$sql.=" limit $p, $pagesize";
$list=$db->getAll($sql);
//echo json_encode($list);
echo "<h1>&nbsp;</h1>\r\n";
echo "<div style=\"margin:0 auto;overflow-x:auto;width:98%;max-width:1188px;\">";
echo "\r\n<!--startprint-->\r\n<h1>共{$lf}预约记录</h1>\r\n";
echo "<table cellspacing=\"0\" class=\"table\"> \r\n";
$ii=0;
if($p<0) $p = 0; //如果
foreach ($list as $lina ) {
$ii++;
if($ii=="1"){
echo "\r\n<thead>\r\n<tr class=\"tt\">\r\n";
$li=0;
foreach ($lina as $il => $de ) {
if(stristr($cd,"-{$il}-")){
echo "<!--隐藏列-->\r\n";
}else{
$li++;
echo "<td><nobr>$il</nobr></td>\r\n";
}
}
echo "</tr>\r\n</thead>\r\n";
echo "\r\n<tbody>\r\n";
}
echo "\r\n<tr>\r\n";
$al = $lina[$rf];$ta = $lina[$tv];
foreach ($lina as $il => $de ) {
$dd="yes";
if(stristr($cd,"-{$il}-")){
$dd="hid";
}elseif($il=="isyue"){
switch ($de) {
case "-1":$de = "黑名单";break;
case "0":$de = "待预约";break;
case "1":$de = "已预约";break;
case "2":$de = "已领取";break;
default:$de = "未知($de)";break;
}
$de = "<td data-label=\"{$il}：\">$de</td>";
}elseif($il=="领取时间"){
if($lina['isyue']<2){
$de = "<td data-label=\"{$il}：\">-</td>";
}else{
$de = "<td data-label=\"{$il}：\">$de</td>";
}
}elseif($il==$ow){
$de = "<td data-label=\"{$il}：\">$de</td>";
}elseif($il==$dr){
if($lina['isyue']<1 ){
$de = "<td data-label=\"{$il}：\">-</td>";
}else{
$de = "<td data-label=\"{$il}：\">$de</td>";
}
}else{
if(strlen(Trim($de))<1){
$de = "<td data-label=\"{$il}：\">-</td>";
}else{
$de = "<td data-label=\"{$il}：\">$de</td>";
}
}
if($dd=="hid"){
echo "<!--hidden 1 lie-->\r\n";
}else{
echo "$de\r\n";
}
}
echo "</tr>\r\n";
$ni = $lina[$rf];
$pk = $lina[$ur];
$us = $lina[$tv];
$wf = " WHERE `预约批次` = '{$ni}' AND `店铺名称` = '{$us}' ";
$yl="SELECT *  FROM `{$no}_shop` {$wf}";
$yl.=" limit 0, 1";
$wx=$db->getAll($yl);
unset($wx[0]['id']);
unset($wx[0]['可约份数']);
unset($wx[0]['check']);
$desc = "";
foreach($wx[0] as $k=>$v) {
$desc .= "$k : <b>$v</b>;";
}
echo "<tr>\r\n";
echo "<td data-label=\"查询提示：\" colspan=\"{$li}\" valign=\"top\">".$desc."</td>\r\n";
echo "</tr>\r\n";
}
if($ii<1){
echo "<tr>\r\n";
echo "<td data-label=\"查询提示：\" colspan=\"{$li}\">暂无预约记录</td>\r\n";
echo "</tr>\r\n";
echo "</tbody>\r\n";
echo "</table>\r\n";
}else{
echo "</tbody>\r\n";
echo "</table>\r\n";
if($pagecount>1){ //页码比0大，表示有数据
echo "<br><table cellspacing=\"0\" class=\"table\"> \r\n";
echo "<tbody> <!-- colspan=\"{$li}\" -->\r\n<tr><td data-label=\"页码：\" >";
if($page>1){
echo '<a href="?page=1' . $urls . '">首页</a> ';
echo '<a href="?page='. ($page-1) . '' . $urls . '">前页</a> ';
	}
if($page<$pagecount){
echo '<a href="?page='. ($page+1) . '' . $urls . '">后页</a> ';
echo '<a href="?page=' . $pagecount . '' . $urls . '">尾页</a> ';
	}
echo '页次<b>' . $page . '</b>/<b>' . $pagecount . '</b> ';
echo '<b>' . $pagesize . '</b>条/页 ';
echo "共<b>$lf</b>条 计发<b>$im</b>元 </td><tr>";
echo "</tbody> \r\n</table>\r\n";
}
}
echo "\r\n<!--endprint-->\r\n</div>\r\n";
?>
</div>
<?php include "inc/foot.php";?>
</div>
</div>
</body>
</html>